<template>
  <div class="app-container">
    <el-table
      v-loading="listLoading"
      height="420px"
      :data="list"
      style="width: 100%"
      row-key="id"
      border
    >
      <el-table-column
        prop="name"
        label="流程名称"
      />
      <el-table-column
        prop="name"
        label="操作"
        width="100"
        align="center"
      >
        <template slot-scope="{row}">
          <el-button type="success" @click="successData(row)">绑定</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import { GetFlowList } from '@/api/SystemManagerApi'

export default {
  data() {
    return {
      listLoading: false,
      list: []
    }
  },
  created() {
    this.getList()
  },
  methods: {
    getList() {
      this.listLoading = true
      GetFlowList().then(response => {
        this.list = response.data
        this.listLoading = false
      })
    },
    successData(row) {
      this.$emit('onSelect', row)
    }
  }
}
</script>
